<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script type="text/javascript" src="static/js/jquery.min.js"></script>
    <script type="text/javascript"
            src="static/js/bootstrap/js/bootstrap.min.js"></script>
    <link rel="stylesheet"
          href="static/js/bootstrap/css/bootstrap.min.css" />
    <link rel="stylesheet"
          href="static/js/bootstrap/css/bootstrap-treeview.min.css"
          th:href="@{static/js/bootstrap/css/bootstrap-treeview.min.css}"
    >
    <script src="static/js/bootstrap/js/bootstrap-treeview.min.js"></script>
    <link rel="stylesheet"
          href="static/js/bootstrap/css/bootstrap.addtabs.css">
    <script src="static/js/bootstrap/js/bootstrap.addtabs.min.js"></script>
    <link rel="stylesheet" href="static//js/bootstrap/css/bootstrap-table.min.css">
    <script src="static/js/bootstrap/js/bootstrap-table.min.js"></script>
    <script src="static/js/bootstrap/js/bootstrap-table-zh-CN.min.js"></script>
    <script src="static/js/bootstrap/js/bootbox.js"></script>
    <link rel="stylesheet"
          href="static/js/bootstrap/css/bootstrap-datetimepicker.min.css" />
    <script type="text/javascript"
            src="static/js/bootstrap/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript"
            src="static/js/bootstrap/js/bootstrap-datetimepicker.zh-CN.js"></script>
    <script src="static/js/bootstrap-fileinput/js/fileinput.js"></script>
    <script src="static/js/bootstrap-fileinput/js/locales/zh.js"></script>
    <link rel="stylesheet" href="static/js/bootstrap-fileinput/css/fileinput.css">

</head>
<body>
<input id="span1" th:type="hidden" th:value="${id.queryPriceId}">
<input id="span2" th:type="hidden" th:value="${id.address}">
<input id="span3" th:type="hidden" th:value="${id.queryPictureId}">
<!-- 材料单回显列表 -->
<form id="myform" method="post">

                <div class="modal-header" style="background-color: #afd9ee">
                    <h4 class="modal-title" id="myModalLabel">查看材料单</h4>
                </div>

                <div class="form-group">
                    <label for="materialsType">类目</label>
                    <input type="text" class="form-control" id="materialsType" placeholder="类目" name="materialsType">
                </div>

                <div class="form-group">
                    <label for="varchar">物料名称</label>
                    <input type="text" class="form-control" id="varchar" placeholder="物料名称" name="varchar">
                </div>

                <div class="form-group">
                    <label for="materialsId">物料编码</label>
                    <input type="text" class="form-control" id="materialsId" placeholder="物料名称" name="materialsId">
                </div>

                <div class="form-group">
                    <label for="materialsCount">数量</label>
                    <input type="text" class="form-control" id="materialsCount" placeholder="数量" name="materialsCount">
                </div>
</form>

<!-- 价格表回显列表 -->
<form id="myform1" method="post">

    <div class="modal-header" style="background-color: #afd9ee">
        <h4 class="modal-title" id="myModalLabel1">服务项报价</h4>
    </div>

    <div class="form-group">
        <label for="materialsType">运费</label>
        <input type="text" class="form-control" id="freight" placeholder="运费" name="freight">
    </div>

    <div class="form-group">
        <label for="varchar">组装费</label>
        <input type="text" class="form-control" id="assemblingCharge" placeholder="组装费" name="assemblingCharge">
    </div>

    <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span>关闭</button>
        <button onclick="save()" class="btn btn-default"><span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>保存</button>
    </div>
</form>
</body>
<script>

    $(function(){
        upHui();
        upMoneyHui();
    })

    var id = $("#span1").val()
    var name = $("#span2").val()
    var name2 = $("#span3").val()
    function upHui(){
        $('#myModal').modal("show");
        $.ajax({
            url: 'selectQuotedChr1',
            data:{id:id,name:name,name2:name2},
            success: function (data) {
                /*需要回显的话用下面的方法 需要传Id的话加Id*/
                $("input[name='materialsType']").val(data.materialsType);
                $("input[name='varchar']").val(data.materialsName);
                $("input[name='materialsId']").val(data.materialsId);
                $("input[name='materialsCount']").val(data.materialsCount);

                $("input[name='freight']").val(data.freight);
                $("input[name='assemblingCharge']").val(data.assemblingCharge);
            }
        })
    }

    function upMoneyHui(){
        $('#myModal1').modal("show");
        $.ajax({
            url: 'selectQuotedChr2',
            data:{id:id,name:name},
            success: function (data) {
                /*需要回显的话用下面的方法 需要传Id的话加Id*/
                $("input[name='freight']").val(data.freight);
                $("input[name='assemblingCharge']").val(data.assemblingCharge);
            }
        })
    }
</script>
</html>